Skip to content

Conversation

@xenova
Copy link
Collaborator

@xenova xenova commented Mar 29, 2025

Example usage:

RF-DETR:

import { pipeline } from '@huggingface/transformers';

const detector = await pipeline('object-detection', 'onnx-community/rfdetr_base-ONNX');

const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
const output = await detector(img, { threshold: 0.75 });
console.log(output);

List of supported models: https://huggingface.co/models?other=rf_detr&library=transformers.js

RT-DETRv2

import { pipeline } from '@huggingface/transformers';

const detector = await pipeline('object-detection', 'onnx-community/rtdetr_v2_r18vd-ONNX');

const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
const output = await detector(img, { threshold: 0.75 });
console.log(output);

List of supported models: https://huggingface.co/models?other=rt_detr_v2&library=transformers.js

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@xenova xenova merged commit c33b6a1 into main Mar 31, 2025
4 checks passed
@xenova xenova deleted the add-rf-detr branch March 31, 2025 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants